﻿<Window x:Class="LockCrypt.WinAddFieldFilter"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:lex="http://schemas.root-project.org/xaml/presentation"
    xmlns:l49="clr-namespace:Lime49;assembly=Lime49"
    Title="{lex:LocText LockCrypt.Core:Strings:AddField}" ResizeMode="NoResize" Style="{StaticResource {x:Type Window}}" Icon="/LockCrypt;component/Resources/LockCrypt.ico"
    MinHeight="100" MinWidth="300" MaxWidth="200" SizeToContent="WidthAndHeight"
    WindowStartupLocation="CenterOwner" Loaded="Window_Loaded"
    FocusManager.FocusedElement="{Binding ElementName=txtFilterFieldName}"
    l49:WindowService.EscapeClosesWindow="True">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Save" Executed="Save" />
        <CommandBinding Command="ApplicationCommands.Close" Executed="CloseWindow" />
    </Window.CommandBindings>
    <Window.Resources>
        <CollectionViewSource x:Key="filterTypeSource"/>
    </Window.Resources>
    <Grid Margin="6">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" MinWidth="100"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Label Grid.Row="0" Grid.Column="0" Content="{lex:LocText LockCrypt.Core:Strings:Name}" />
        <ComboBox Grid.Row="0" Grid.Column="1" x:Name="cboFilterFieldName" ItemsSource="{Binding Source={StaticResource filterTypeSource}}" TabIndex="1" IsSynchronizedWithCurrentItem="False" />
        <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" x:Name="txtFilterFieldName" TabIndex="2" />

        <Label Grid.Row="1" Grid.Column="0" Content="{lex:LocText LockCrypt.Core:Strings:Value}" />
        <ComboBox Grid.Row="1" Grid.Column="1" x:Name="cboFilterFieldValue" ItemsSource="{Binding Source={StaticResource filterTypeSource}}" TabIndex="3" IsSynchronizedWithCurrentItem="False" />
        <TextBox Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" x:Name="txtFilterFieldValue" TabIndex="4"/>
        
        <StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Grid.Column="3" x:Name="btnSave" TabIndex="5" MinWidth="70" IsDefault="True" Command="ApplicationCommands.Save" Content="{lex:LocText LockCrypt.Core:Strings:Add}" />
            <Button Grid.Column="4" x:Name="btnCancel" TabIndex="6" MinWidth="70" IsCancel="True" Command="ApplicationCommands.Close" Content="{lex:LocText LockCrypt.Core:Strings:Cancel}"/>
        </StackPanel>
    </Grid>
</Window>
